package com.juyu.miliao.api.dao.mysql;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.juyu.miliao.api.domain.Gift;

import javax.annotation.Resource;

@Repository
public class GiftDao {
	@Resource
	private SqlSession sqlSession;
	
	public List<Gift> getGiftList(){
		return sqlSession.selectList("getGiftList");
	}

    public List<Gift> getGiftListByType(int type) {
		return sqlSession.selectList("getGiftListByType",type);
    }

	public Gift getGiftById(int giftId){
		return sqlSession.selectOne("getGiftById", giftId);
	}

}
